package cn.lanqiao.jdbc;

import java.util.List;

public class UserDao extends BaseDao<User>{

    public int insert(User user) {
        return executeUpdate("insert into sys_user (user_name,password) values (?,?)",user.getUserName(),user.getPassword());
    }

    public int delete(int id) {
        return executeUpdate("delete form sys_user where id = ?" , id);
    }

    public int update(User user) {
        return executeUpdate("");
    }

    public List<User> query(String sql){
        return executeQuery(sql);
    }

    public static void main(String[] args) {
        List list = new UserDao().query("select * from sys_user");
        list.forEach(e -> System.out.println(e));
    }
}
